package com.test.component;

import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@EnableApolloConfig
@Configuration
public class MyConfig {

//    @Bean("someBean")
    @Bean
//    @Scope()
    public SomeBean getBean() {

        return new SomeBean();
//        return null;
    }


    @Bean
    public FilterRegistrationBean registrationBean() {


        FilterRegistrationBean filterBean = new FilterRegistrationBean();

        filterBean.setFilter(new SessionFilter());
        filterBean.setName("sessionFilter");
        filterBean.addUrlPatterns("/*");

        return filterBean;
    }
}
